<?php
namespace Tbf\Component\DateTime\DateSequence;

/**
 * 一次时间序列
 */
class OnceDateSequence extends AbstractDateSequence
{
    protected $time;
    public function __construct(\DateTime $time)
    {
        $this->time = $time;
        $this->rewind();
    }
    public function valid()
    {
        if ($this->position===0) {
            return true;
        } else {
            return false;
        }
    }
    public function current()
    {
        return $this->time;
    }
}
